package org.genntii.smuserserver.client;

import org.genntii.smcommon.result.Result;
import org.genntii.smdomain.vo.ArticleVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;

@FeignClient("sm-article")
public interface ArticleClient {

    @GetMapping("/article/getByUser/{userId}")
    Result<ArrayList<ArticleVO>> getArticleByUserId(@PathVariable Long userId);
    @GetMapping("/article/articleLimit")
    Result<ArrayList<ArticleVO>> getArticleLimit(@RequestParam("userId") Long userId,
                                                        @RequestParam("pageNum") Integer pageNum,
                                                        @RequestParam("pageSize") Integer pageSize);

    @GetMapping("/article/batch")
    Result<ArrayList<ArticleVO>> getArticleVOByIds(@RequestParam("ids")ArrayList<Long> ids,
                                                          @RequestParam("userId")Long userId);

    @GetMapping("/article/userTotal/{userId}")
    Result<Long> getTotal(@PathVariable Long userId);
}
